# 定义一个元组变量
coordinates = (3, 4)

# 打印变量的值
print("Coordinates:", coordinates)

# 访问元组中的特定元素
x_coordinate = coordinates[0]
print("X coordinate:", x_coordinate)

# 切片操作提取子元组
subtuple = coordinates[1:2]
print("Subtuple from index 1 to 2:", subtuple)

# 尝试修改元组的元素（会引发错误）
try:
    coordinates[0] = 5
except TypeError as e:
    print("Error:", e)
